package com.zretc.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zretc.dao.CommentMapper;
import com.zretc.entity.Comment;
import com.zretc.entity.OrderDetail;
import com.zretc.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author: bLUeSuMMerDreamer
 * @createTime: 2020-08-30 04:06
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public PageInfo<Comment> getComments(Map<String, Object> params) {
        Integer pageNum = (Integer) params.get("pageNum");
        Integer pageSize = (Integer) params.get("pageSize");
        PageHelper.startPage(pageNum, pageSize);
        List<Comment> comments = commentMapper.getComments(params);
        return new PageInfo<>(comments);
    }
}
